package edu.udel.mboch.towerdefense;

import java.io.Serializable;
import java.util.ArrayList;

public class Waves implements Serializable
{
	private static final long serialVersionUID = -4253774046971423236L;

	public static final int MAX_WAVES = 8;
	
	public ArrayList<ArrayList<Character>> waves;
	
	public Waves()
	{
		waves = new ArrayList<ArrayList<Character>>(); //B = BasicMob, F = FastMob, H = HeavyMob, X = BossMob, ' ' = nothing
		waves.add(getWaveMobs("   B B B      "));
		waves.add(getWaveMobs("B B F B  F      "));
		waves.add(getWaveMobs("FFFFFFFFFF      "));
		waves.add(getWaveMobs("BB  FF  BFBB FFB BBBBF      "));
		waves.add(getWaveMobs("BBH   FFH      "));
		waves.add(getWaveMobs("FFFF FFHFFFFH FFFFFFF      "));
		waves.add(getWaveMobs("BFBFHFBFHBFFHHHBFBHHHHHFBF      "));
		waves.add(getWaveMobs("X     X"));
		
		
	}
	
	private ArrayList<Character> getWaveMobs(String wave)
	{
		ArrayList<Character> mobs = new ArrayList<Character>();
		for(char c : wave.toCharArray())
			mobs.add(Character.valueOf(c));
		return mobs;
	}
	
	public int getWaveNumber()
	{
		if(waves.size()>0)
			return MAX_WAVES - waves.size() + 1;
		return MAX_WAVES;
	}
	
	public int getTrueWaveNumber()
	{
		return MAX_WAVES - waves.size() + 1;
	}
	
	public ArrayList<ArrayList<Character>> getWaves()
	{
		return waves;
	}
}
